#include #include using namespace std; void main() { double money; int wholeMoney; int cents; //11.999 cin >> money; wholeMoney = (int)money; cents = (int)((money - wholeMoney) * 100 + .5); cout << wholeMoney << endl; cout << cents << endl; } ///////////////////////////////////////////////////////////////// #include using namespace std; void main() { //the condtion for a switch must be a whole number //int, long, short, char, bool //switch( condition ) //switchs do not do ranges, only exact matches //cases must be constants or literals //cases must be unique per switch //falling-through - when there is not a break between cases //int grade; //cin >> grade; //switch(grade/10) //{ // case 10: // case 9: // cout << "A" << endl; // break; // case 8: // cout << "B" << endl; // break; // case 7: // cout << "C" << endl; // break; // case 6: // cout << "D" << endl; // break; // default: // cout << "F" << endl; // break; //} //char c; //cin >> c; //switch(c) //{ // case 'A': // cout << "Your choice is A"; // break; // case 'B': // cout << "Your choice is B"; // break; // case 'C': // cout << "Your choice is C"; // break; // case 'D': // cout << "Your choice is D"; // break; // case 'E': // cout << "Your choice is E"; // break; // default: // cout << "Invalid choice" << endl; // break; //} //int dayOfChristmas; //cin >> dayOfChristmas; //switch(dayOfChristmas) //{ // case 12: cout << "12 drummers drumming" << endl; // case 11: cout << "11 pipers piping " << endl; // case 10: cout << "10 lords a-leaping " << endl; // case 9: cout << "9 ladies dancing " << endl; // case 8: cout << "8 maids a-milking " << endl; // case 7: cout << "7 swans a-swimming " << endl; // case 6: cout << "6 geese a-laying " << endl; // case 5: cout << "5 golden rings " << endl; // case 4: cout << "4 calling birds " << endl; // case 3: cout << "3 french hens " << endl; // case 2: cout << "2 turtle-doves " << endl; // cout << "and "; // case 1: cout << "a partridg in a peartree" << endl; // break; // default: // cout << "That is not a valid day of Chritsmas"; //} //escape sequence - a special series of 2 characters that repersent a single character //allwayes begin with \ //\n - line feed //\t - tab //\a - alarm (beep) //\b - backspace //\r - carrage return }